#coding=utf-8
import time
from selenium import webdriver
from appium import webdriver

import sys
from time import sleep

el_not_find = '控件未找到，控件名称：'

class Base():
    driver = None
    desired_caps = {}
    desired_caps['platformName'] = 'Android'
    # desired_caps['platformVersion'] = '4.3'
    # desired_caps['deviceName'] = '50a4c97e'
    desired_caps['platformVersion'] = '6.0'
    desired_caps['deviceName'] = '10463120'
    desired_caps['appPackage'] = 'cn.com.egova.egovamobile'
    desired_caps['appActivity'] = '.login.LoginActivity'
    desired_caps['unicodeKeyboard'] = True
    desired_caps['resetKeyboard'] = True

    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
    # driver.find_element().is_displayed()
    sleep(5)
    el = driver.find_element_by_id("cn.com.egova.egovamobile:id/login_set_server_url")
    print el
    el.click()


def test():
    return 0

if __name__ == '__main__':
    # base = Base()
    test = ['登录输入框','id',"cn.com.egova.egovamobile:id/login_txtUsername"]
    baseFunction = Base()
    print  test[2]
    # el = baseFunction.find_element(test)
    # el.clear()
    # baseFunction.element_send_keys(test,'test')
    # baseFunction.element_save_pic('d:/','测试')